package canglang.monitor.cases.service.impl;

import canglang.monitor.cases.dao.CaseSevenDAO;
import canglang.monitor.cases.model.CaseSevenModel;
import canglang.monitor.cases.model.CaseLightModel;
import canglang.monitor.cases.service.CaseSevenMgr;
import canglang.monitor.cases.service.CaseLightMgr;
import canglang.monitor.cases.to.SearchSevenTO;
import canglang.monitor.core.base.pagination.PaginatedListHelper;
import canglang.monitor.core.base.util.DateUtil;

import java.util.List;
import java.util.Date;

public class CaseSevenMgrImpl implements CaseSevenMgr {

	private CaseSevenDAO caseSevenDAO;

	public void setCaseSevenDAO(CaseSevenDAO caseSevenDAO) {
		this.caseSevenDAO = caseSevenDAO;
	}

	public CaseSevenModel addCaseSeven(CaseSevenModel caseSevenModel) {
		int id=caseSevenDAO.addCaseSeven(caseSevenModel);
		return caseSevenDAO.getCaseSeven(id);
	}

	public CaseSevenModel getCaseSeven(int caseSevenId) {
		return caseSevenDAO.getCaseSeven(caseSevenId);
	}

	public CaseSevenModel saveCaseSeven(CaseSevenModel caseSevenModel) {
        return caseSevenDAO.saveCaseSeven(caseSevenModel);
	}

	public void deleteCaseSeven(int caseSevenId) {
		caseSevenDAO.deleteCaseSeven(caseSevenId);
	}

    public PaginatedListHelper search(PaginatedListHelper helper, SearchSevenTO searchTO){
        int count = caseSevenDAO.searchCount(searchTO);
        helper.setFullListSize(count);
        List list = caseSevenDAO.searchList(helper, searchTO);
        helper.setList(list);
        return helper;
    }

     public List getCaseSevenList(SearchSevenTO searchTO){
        return caseSevenDAO.getCaseSevenList(searchTO);
    }
}